<?php
namespace Core\http;
class  Response{
    /**
     * @var \Swoole\Http\Response
     */
    protected $swooleReponse;
    protected $body;


    public function __construct($swooleReponse)
    {
        $this->swooleReponse = $swooleReponse;
    }
    public static function init(\Swoole\Http\Response $response)
    {
        return new self($response);
    }
    public function getBody()
    {
        return $this->body;
    }
    public function setBody($body)
    {
        $this->body = $body;
    }
    public function end(){
        $this->swooleReponse->write($this->getBody());
        $this->swooleReponse->end();
    }



}